home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / wsh.vim < prev    next >
Encoding:
Text File  |  2001-01-16  |  1.2 KB  |  46 lines

  1. " Vim syntax file
  2. " Language:    Windows Scripting Host
  3. " Maintainer:    Paul Moore <gustav@morpheus.demon.co.uk>
  4. " Last Change:    Fre, 24 Nov 2000 21:54:09 +0100
  5.  
  6. " This reuses the XML, VB and JavaScript syntax files. While VB is not
  7. " VBScript, it's close enough for us. No attempt is made to handle
  8. " other languages.
  9. " Send comments, suggestions and requests to the maintainer.
  10.  
  11. " Quit when a syntax file was already loaded
  12. if exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. let s:wsh_cpo_save = &cpo
  17. set cpo&vim
  18.  
  19. runtime! syntax/xml.vim
  20. unlet b:current_syntax
  21.  
  22. syn case ignore
  23. syn include @wshVBScript <sfile>:p:h/vb.vim
  24. unlet b:current_syntax
  25. syn include @wshJavaScript <sfile>:p:h/javascript.vim
  26. unlet b:current_syntax
  27. syn region wshVBScript
  28.     \ matchgroup=xmlTag    start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)"
  29.     \ matchgroup=xmlEndTag end="</script>"
  30.     \ fold
  31.     \ contains=@wshVBScript
  32.     \ keepend
  33. syn region wshJavaScript
  34.     \ matchgroup=xmlTag    start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)"
  35.     \ matchgroup=xmlEndTag end="</script>"
  36.     \ fold
  37.     \ contains=@wshJavaScript
  38.     \ keepend
  39.  
  40. syn cluster xmlRegionHook add=wshVBScript,wshJavaScript
  41.  
  42. let b:current_syntax = "wsh"
  43.  
  44. let &cpo = s:wsh_cpo_save
  45. unlet s:wsh_cpo_save
  46.